# !/bin/bash

cd /root/rpmbuild/BUILD/dsoftbus_build
./build.sh --product-name openEuler

# 复制动态库到目前路径
mkdir -p /root/softbus_out/lib
mkdir -p /root/softbus_out/include/dsoftbus
mkdir -p /root/softbus_out/bin

# 复制动态库
find . -name "*.z.so" -exec cp {} /root/softbus_out/lib \;

# 复制可执行程序
# find . -name "*softbus_server_main" -exec cp {} /root/softbus_out/bin \;
cp ./out/ohos-x86_64-release/communication/dsoftbus_standard/softbus_server_main /root/softbus_out/bin

cd ..
# 复制头文件
cp ./dsoftbus_build/depend/syspara/include/parameter.h /root/softbus_out/include
cp ./dsoftbus_build/third_party/cJSON/cJSON.h /root/softbus_out/include/dsoftbus
# cJSON_Utils.h not found
cp ./dsoftbus_build/base/security/deviceauth/interfaces/innerkits/device_auth.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_build/base/security/deviceauth/interfaces/innerkits/device_auth_defines.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_standard/interfaces/kits/discovery/discovery_service.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_build/third_party/bounds_checking_function/include/securec.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_build/third_party/bounds_checking_function/include/securectype.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_standard/interfaces/kits/transport/session.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_standard/interfaces/kits/bus_center/softbus_bus_center.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_standard/interfaces/kits/common/softbus_common.h /root/softbus_out/include/dsoftbus
cp ./dsoftbus_standard/core/common/include/softbus_errcode.h /root/softbus_out/include/dsoftbus

echo "compile done."

